﻿ //===============================RuinAlgorithm.cs==============================\\
//===Bart Steijlen======\\

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Drawing.Imaging;

namespace Team2_Vision
{
    class RuinPixels : VisionAlgorithm
    {
        public RuinPixels(String name) : base(name) { }
        public override System.Drawing.Bitmap DoAlgorithm(System.Drawing.Bitmap sourceImage, int intensity)
        {
            int sizeMap = ((sourceImage.Width * sourceImage.Height) / 500);
            Random random = new Random();
            Bitmap returnImage = new Bitmap(sourceImage);
            int randx, randy;
            Color pixel;
            for (int i = 0; i < intensity; i++)
            {
                randx = random.Next(sourceImage.Width);
                randy = random.Next(sourceImage.Height);
                pixel = sourceImage.GetPixel(randx,randy);

                for (int j = 0; j < intensity; j++)
                {
                    randx = random.Next(sourceImage.Width);
                    randy = random.Next(sourceImage.Height);
                    returnImage.SetPixel(randx, randy, pixel);
                }
            }

            return returnImage;
        }
    }
}